<!DOCTYPE>
<html>
<head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
  <title> cpchat </title>
  <link rel="stylesheet" type="text/css" href="{$data['pub']}/css/base.css" />
  <script type="text/javascript" src="{$data['pub']}/chat/js/jStore/jquery142.min.js"></script>
  <script type="text/javascript" src="{$data['pub']}/chat/js/jStore/jquery.jstore-all.js"></script>
  <script type="text/javascript" src="{$data['pub']}/chat/js/chat2.js"></script>
  <script src="http://{$data['ip']}:{$data['port']}/socket.io/socket.io.js"></script>
  <script type="text/javascript">  
	window.onload = function(){
		window.parent['{$group}_{$uid}_{$uid2}'] = function(a, b, c){
			log(a, b, c);
		}
		window.parent[{$group}]['{$uid}_{$uid2}'].close = function(){
			this.hide();
		}
	}
  jQuery.extend(jQuery.jStore.defaults, {
    project: 'chat',
    engine: 'flash',
    flash: '{$data["pub"]}/chat/js/jstore/jStore.Flash.html'
  });  
  </script>
  <style type="text/css">
    .aui_content{padding:0;}
  </style>
 </head>
 <body>
 <script type="text/javascript">
  var socket = window.parent['{$uid}_socket']; 
 
  
  function sendToSer(){
    var sendTo = $('#send-to').val();
    var text = htmlEnCode($('#send-content').val());
    if(text == ''){
      alert('消息不能为空');
      return false;
    }
    if(sendTo != ''){
      socket.emit('privatemsgs',{'sendTo':sendTo,'text':text});
    }
    log('{$nickname}　'+timeFormat(), text, 'green'); 
    $('#send-content').val('');
  
  }
	
	function closePChat(){
		var key = $('#send-to').val();		
		window.parent[{$group}]['{$uid}_'+key].close();		
	}
  
  </script>
 <div class="w500 auto bg_eee  left border">
  <div class=" bg_fff h300 " id="">
    <div id="chat_banner" class="h10 p5"></div>
    <div id="chatbox" class="h260 p5" style="overflow-y:scroll;">
    
    </div>
  </div>
<div class=" bg_ccc mt6 h30 tar">
</div>
<div class=" bg_fff mt6 h90">
<textarea class="w500" rows="3" onkeyup="var e = event ? event :(window.event ? window.event : null);if(e.keyCode==13){ sendToSer()} " id="send-content"></textarea>
</div>
<input type="hidden" id="send-to" value="{$uid2}"/>
<div class="btn tar"><a href="javascript:;" class="button" onclick='sendToSer()'>发送消息</a> <a href="javascript:;" onclick="closePChat();" class="button">关闭</a></div>
</div>

 </body>
</html>